RM.Pages.Functions.livechat_encode = {


	// public method for encoding
	encode : function (input) {

                var output;
                var isHTTP = input.substr(0,4);
                
                if (isHTTP.toLowerCase()=="http"){
                    output = encodeURI(input);
                } else {
                    output = escape(input);
                }

		return output;
	},

	// public method for decoding
	decode : function (input) {

                var output;
                var isHTTP = input.substr(0,4);

                 if (isHTTP.toLowerCase()=="http"){
                    output = decodeURI("<a href='"+input+"' target='_blank'>"+input+"</a>");
                } else {
                    output = unescape(input);
                }

		return output;

	}
}